<template>
    <!-- 根据最新的菜单索引(标识 , 从 pinia 中获取), 获取到菜单索引对应的文字描述, 实现面包屑的动态渲染 -->
    <el-breadcrumb separator="/" class="breadcrumb">
        <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item v-for="(item,index) in menuStore.menuData" :key="index">{{ getText( item )}}</el-breadcrumb-item>
    </el-breadcrumb>
</template>

<script setup>
import {getText} from '@/utils/tool'
import { useMenuStore } from '@/stores/menu'
var menuStore = useMenuStore();

</script>

<style scoped>
.breadcrumb{
    margin: 20px 0;
}
</style>